<template>
	<view class="bottom-btns">
		<view class="btn" :class="nowBtn == btn && 'active'" v-for="btn in btnArr" @click="btnClick(btn)" :key="btn">
			{{btn}}
		</view>

	</view>
</template>

<script setup lang="ts">
	import { ref } from 'vue';
	const emits = defineEmits(['btnClick'])
	const props = defineProps({
		btnArr: {
			type: Array,
			default: () => []
		}

	})
	const nowBtn = ref(props.btnArr[0])
	function btnClick(btn : string) {
		nowBtn.value = btn
		emits('btnClick', btn)
	}
</script>

<style scoped lang="scss">
	.bottom-btns {
		display: flex;
		justify-content: center;
		align-items: center;
		width: 100%;
		height: 76rpx;
		color: $info-color;
		border-radius: 48rpx;
		background: #EFF6FE;
		box-shadow: 0rpx 0rpx 16rpx 0rpx rgba(0, 0, 0, 0.04);
		box-sizing: border-box;

		.btn {
			width: 100%;
			height: 60rpx;
			margin: 8rpx 10rpx;
			font-size: 28rpx;
			color: $info-color;
			text-align: center;
			line-height: 60rpx;
			border-radius: 56rpx;
			box-sizing: border-box;

			&.active {
				color: #fff;
				background-color: $primary-color;
			}
		}
	}
</style>